package com.jeedlelabs.tubess;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;

public class VideoAdapter extends BaseAdapter {

	private Context mContext;
	private String [] urls = new String [10];
	private ImageDownloader downloader; 
	
	
	
	public VideoAdapter(Context c)
	{
		mContext = c;		 
		urls[0] = "http://i.ytimg.com/vi/OpQFFLBMEPI/mqdefault.jpg";
        urls[1] = "http://i.ytimg.com/vi/Ahha3Cqe_fk/mqdefault.jpg";
        urls[2] = "http://i.ytimg.com/vi/5y_KJAg8bHI/mqdefault.jpg"; 
        urls[3] = "http://i.ytimg.com/vi/PVzljDmoPVs/mqdefault.jpg";
        urls[4] = "http://i.ytimg.com/vi/ekzHIouo8Q4/mqdefault.jpg";
        urls[5] = "http://i.ytimg.com/vi/QK8mJJJvaes/mqdefault.jpg";
        urls[6] = "http://i.ytimg.com/vi/AJVpL6L7Zeo/mqdefault.jpg";
        urls[7] = "http://i.ytimg.com/vi/mO1QBTG6EXs/mqdefault.jpg";
        urls[8] = "http://i.ytimg.com/vi/rYEDA3JcQqw/mqdefault.jpg";
        urls[9] = "http://i.ytimg.com/vi/hLQl3WQQoQ0/mqdefault.jpg";
	}

	@Override
	public int getCount() {
		return 10;
	}

	@Override
	public Object getItem(int arg0) {
		return null;
	}

	@Override
	public long getItemId(int arg0) {
		return 0;
	}

	@Override
	public View getView(int arg0, View arg1, ViewGroup arg2) {

		ImageView imageView;
		
		if (arg1 == null)
		{						
			imageView =new ImageView(mContext);
			/*downloader =  new ImageDownloader(imageView,arg0);		*/
	    }
		else
		{
			imageView = (ImageView)arg1;
			/*downloader =  new ImageDownloader(imageView,arg0);*/
		}
	      downloader.execute(urls);
	    //imageView.setImageBitmap(pictures.get(arg0));
		return imageView;
	}

}
